package com.bridgeintelligent.tag.bulkload.service.core.iterator;

import java.util.Iterator;
import java.util.List;

/**
 * Created by JackCheung on 2019/9/24 12:05 AM.
 */
public class BulkListIterator<T> implements BulkIterator {

    private Iterator<T> iterator;

    public BulkListIterator(List<T> elements) {
        this.iterator = elements.iterator();
    }

    /**
     * 是否还有下一个元素
     *
     * @return
     */
    @Override
    public boolean hasNext() {
        return iterator.hasNext();
    }

    /**
     * 获取下一个元素
     *
     * @return
     */
    @Override
    public Object next() {
        return iterator.next();
    }
}
